<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="归档: 2021/12, 技术,教训,心情">
    <meta name="description" content="学习！学习！学习！">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>归档: 2021/12 | 600客街</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery-3.6.0.min.js"></script>

<meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="600客街" type="application/atom+xml">
</head>




<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">600客街</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">600客街</div>
        <div class="logo-desc">
            
            学习！学习！学习！
            
        </div>
    </div>

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
    </ul>
</div>


        </div>

        
    </nav>

</header>

    <div class="bg-cover pd-header about-cover">
    <div class="container">
    <div class="row">
    <div class="col s10 offset-s1 m8 offset-m2 l8 offset-l2">
        <div class="brand">
            <div class="title center-align">
                
                及时享乐
                
            </div>

            <div class="description center-align">
                
                <span id="subtitle"></span>
                <script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11"></script>
                <script>
                    var typed = new Typed("#subtitle", {
                        strings: [ 
                            
                                "从来没有真正的绝境, 只有心灵的迷途",
                            
                                "Never really desperate, only the lost of the soul",
                            
                        ],
                        startDelay: 300,
                        typeSpeed: 100,
                        loop: true,
                        backSpeed: 50,
                        showCursor: true
                    });
                </script>
                
            </div>
        </div>
    </div>
</div>


<script>
    // 每天切换 banner 图.  Switch banner image every day.
    var bannerUrl = "/medias/banner/" + new Date().getDay() + '.jpg';
    $('.bg-cover').css('background-image', 'url(' + bannerUrl + ')');
</script>


    </div>
</div>

<main class="content">

    
    <div class="container archive-calendar">
    <div class="card">
        <div id="post-calendar" class="card-content"></div>
    </div>
</div>

<script type="text/javascript" src="/libs/echarts/echarts.min.js"></script>
<script type="text/javascript">
    let myChart = echarts.init(document.getElementById('post-calendar'));

    

    let option = {
        title: {
            top: 0,
            text: '文章日历',
            left: 'center',
            textStyle: {
                color: '#3C4858'
            }
        },
        tooltip: {
            padding: 10,
            backgroundColor: '#555',
            borderColor: '#777',
            borderWidth: 1,
            formatter: function (obj) {
                var value = obj.value;
                return '<div style="font-size: 14px;">' + value[0] + '：' + value[1] + '</div>';
            }
        },
        visualMap: {
            show: true,
            showLabel: true,
            categories: [0, 1, 2, 3, 4],
            calculable: true,
            inRange: {
                symbol: 'rect',
                color: ['#ebedf0', '#c6e48b', '#7bc96f', '#239a3b', '#196127']
            },
            itemWidth: 12,
            itemHeight: 12,
            orient: 'horizontal',
            left: 'center',
            bottom: 0
        },
        calendar: [{
            left: 'center',
            range: ["2021-05-24", "2022-05-24"],
            cellSize: [13, 13],
            splitLine: {
                show: false
            },
            itemStyle: {
                color: '#196127',
                borderColor: '#fff',
                borderWidth: 2
            },
            yearLabel: {
                show: false
            },
            monthLabel: {
                nameMap: 'cn',
                fontSize: 11
            },
            dayLabel: {
                formatter: '{start}  1st',
                nameMap: 'cn',
                fontSize: 11
            }
        }],
        series: [{
            type: 'heatmap',
            coordinateSystem: 'calendar',
            calendarIndex: 0,
            data: [["2021-05-24", 0], ["2021-05-25", 0], ["2021-05-26", 0], ["2021-05-27", 0], ["2021-05-28", 0], ["2021-05-29", 0], ["2021-05-30", 0], ["2021-05-31", 0], ["2021-06-01", 0], ["2021-06-02", 0], ["2021-06-03", 0], ["2021-06-04", 0], ["2021-06-05", 0], ["2021-06-06", 0], ["2021-06-07", 0], ["2021-06-08", 0], ["2021-06-09", 0], ["2021-06-10", 0], ["2021-06-11", 0], ["2021-06-12", 0], ["2021-06-13", 0], ["2021-06-14", 0], ["2021-06-15", 0], ["2021-06-16", 0], ["2021-06-17", 0], ["2021-06-18", 0], ["2021-06-19", 0], ["2021-06-20", 0], ["2021-06-21", 0], ["2021-06-22", 0], ["2021-06-23", 0], ["2021-06-24", 0], ["2021-06-25", 0], ["2021-06-26", 0], ["2021-06-27", 0], ["2021-06-28", 0], ["2021-06-29", 0], ["2021-06-30", 0], ["2021-07-01", 0], ["2021-07-02", 0], ["2021-07-03", 0], ["2021-07-04", 0], ["2021-07-05", 0], ["2021-07-06", 0], ["2021-07-07", 0], ["2021-07-08", 0], ["2021-07-09", 0], ["2021-07-10", 0], ["2021-07-11", 0], ["2021-07-12", 0], ["2021-07-13", 0], ["2021-07-14", 0], ["2021-07-15", 0], ["2021-07-16", 0], ["2021-07-17", 0], ["2021-07-18", 0], ["2021-07-19", 0], ["2021-07-20", 0], ["2021-07-21", 0], ["2021-07-22", 0], ["2021-07-23", 0], ["2021-07-24", 0], ["2021-07-25", 0], ["2021-07-26", 0], ["2021-07-27", 0], ["2021-07-28", 0], ["2021-07-29", 0], ["2021-07-30", 0], ["2021-07-31", 0], ["2021-08-01", 0], ["2021-08-02", 0], ["2021-08-03", 0], ["2021-08-04", 0], ["2021-08-05", 0], ["2021-08-06", 0], ["2021-08-07", 0], ["2021-08-08", 0], ["2021-08-09", 0], ["2021-08-10", 0], ["2021-08-11", 0], ["2021-08-12", 0], ["2021-08-13", 0], ["2021-08-14", 0], ["2021-08-15", 0], ["2021-08-16", 0], ["2021-08-17", 0], ["2021-08-18", 0], ["2021-08-19", 0], ["2021-08-20", 0], ["2021-08-21", 0], ["2021-08-22", 0], ["2021-08-23", 0], ["2021-08-24", 0], ["2021-08-25", 0], ["2021-08-26", 0], ["2021-08-27", 0], ["2021-08-28", 0], ["2021-08-29", 0], ["2021-08-30", 0], ["2021-08-31", 0], ["2021-09-01", 0], ["2021-09-02", 0], ["2021-09-03", 0], ["2021-09-04", 0], ["2021-09-05", 0], ["2021-09-06", 0], ["2021-09-07", 0], ["2021-09-08", 0], ["2021-09-09", 0], ["2021-09-10", 0], ["2021-09-11", 0], ["2021-09-12", 0], ["2021-09-13", 0], ["2021-09-14", 0], ["2021-09-15", 0], ["2021-09-16", 0], ["2021-09-17", 0], ["2021-09-18", 0], ["2021-09-19", 0], ["2021-09-20", 0], ["2021-09-21", 0], ["2021-09-22", 0], ["2021-09-23", 0], ["2021-09-24", 0], ["2021-09-25", 0], ["2021-09-26", 0], ["2021-09-27", 0], ["2021-09-28", 0], ["2021-09-29", 0], ["2021-09-30", 0], ["2021-10-01", 0], ["2021-10-02", 0], ["2021-10-03", 0], ["2021-10-04", 0], ["2021-10-05", 0], ["2021-10-06", 0], ["2021-10-07", 0], ["2021-10-08", 0], ["2021-10-09", 0], ["2021-10-10", 0], ["2021-10-11", 0], ["2021-10-12", 0], ["2021-10-13", 0], ["2021-10-14", 0], ["2021-10-15", 0], ["2021-10-16", 0], ["2021-10-17", 0], ["2021-10-18", 0], ["2021-10-19", 0], ["2021-10-20", 0], ["2021-10-21", 0], ["2021-10-22", 0], ["2021-10-23", 0], ["2021-10-24", 0], ["2021-10-25", 0], ["2021-10-26", 0], ["2021-10-27", 0], ["2021-10-28", 0], ["2021-10-29", 0], ["2021-10-30", 0], ["2021-10-31", 0], ["2021-11-01", 0], ["2021-11-02", 0], ["2021-11-03", 0], ["2021-11-04", 0], ["2021-11-05", 0], ["2021-11-06", 0], ["2021-11-07", 0], ["2021-11-08", 0], ["2021-11-09", 0], ["2021-11-10", 0], ["2021-11-11", 0], ["2021-11-12", 0], ["2021-11-13", 0], ["2021-11-14", 0], ["2021-11-15", 0], ["2021-11-16", 0], ["2021-11-17", 0], ["2021-11-18", 0], ["2021-11-19", 0], ["2021-11-20", 0], ["2021-11-21", 0], ["2021-11-22", 0], ["2021-11-23", 0], ["2021-11-24", 0], ["2021-11-25", 0], ["2021-11-26", 0], ["2021-11-27", 0], ["2021-11-28", 0], ["2021-11-29", 0], ["2021-11-30", 0], ["2021-12-01", 0], ["2021-12-02", 0], ["2021-12-03", 0], ["2021-12-04", 0], ["2021-12-05", 0], ["2021-12-06", 0], ["2021-12-07", 0], ["2021-12-08", 0], ["2021-12-09", 0], ["2021-12-10", 0], ["2021-12-11", 0], ["2021-12-12", 0], ["2021-12-13", 0], ["2021-12-14", 2], ["2021-12-15", 0], ["2021-12-16", 5], ["2021-12-17", 0], ["2021-12-18", 3], ["2021-12-19", 0], ["2021-12-20", 13], ["2021-12-21", 17], ["2021-12-22", 0], ["2021-12-23", 0], ["2021-12-24", 0], ["2021-12-25", 0], ["2021-12-26", 1], ["2021-12-27", 1], ["2021-12-28", 0], ["2021-12-29", 1], ["2021-12-30", 0], ["2021-12-31", 0], ["2022-01-01", 1], ["2022-01-02", 0], ["2022-01-03", 0], ["2022-01-04", 1], ["2022-01-05", 0], ["2022-01-06", 1], ["2022-01-07", 1], ["2022-01-08", 1], ["2022-01-09", 0], ["2022-01-10", 0], ["2022-01-11", 1], ["2022-01-12", 0], ["2022-01-13", 0], ["2022-01-14", 0], ["2022-01-15", 2], ["2022-01-16", 0], ["2022-01-17", 1], ["2022-01-18", 0], ["2022-01-19", 0], ["2022-01-20", 0], ["2022-01-21", 0], ["2022-01-22", 2], ["2022-01-23", 1], ["2022-01-24", 0], ["2022-01-25", 0], ["2022-01-26", 0], ["2022-01-27", 0], ["2022-01-28", 0], ["2022-01-29", 0], ["2022-01-30", 0], ["2022-01-31", 0], ["2022-02-01", 0], ["2022-02-02", 0], ["2022-02-03", 0], ["2022-02-04", 1], ["2022-02-05", 0], ["2022-02-06", 0], ["2022-02-07", 0], ["2022-02-08", 0], ["2022-02-09", 0], ["2022-02-10", 0], ["2022-02-11", 0], ["2022-02-12", 1], ["2022-02-13", 0], ["2022-02-14", 0], ["2022-02-15", 0], ["2022-02-16", 0], ["2022-02-17", 0], ["2022-02-18", 1], ["2022-02-19", 0], ["2022-02-20", 0], ["2022-02-21", 0], ["2022-02-22", 0], ["2022-02-23", 0], ["2022-02-24", 0], ["2022-02-25", 0], ["2022-02-26", 0], ["2022-02-27", 0], ["2022-02-28", 0], ["2022-03-01", 0], ["2022-03-02", 0], ["2022-03-03", 0], ["2022-03-04", 0], ["2022-03-05", 0], ["2022-03-06", 0], ["2022-03-07", 0], ["2022-03-08", 0], ["2022-03-09", 0], ["2022-03-10", 0], ["2022-03-11", 0], ["2022-03-12", 0], ["2022-03-13", 0], ["2022-03-14", 0], ["2022-03-15", 0], ["2022-03-16", 0], ["2022-03-17", 0], ["2022-03-18", 0], ["2022-03-19", 0], ["2022-03-20", 1], ["2022-03-21", 0], ["2022-03-22", 0], ["2022-03-23", 0], ["2022-03-24", 0], ["2022-03-25", 0], ["2022-03-26", 0], ["2022-03-27", 0], ["2022-03-28", 0], ["2022-03-29", 0], ["2022-03-30", 0], ["2022-03-31", 0], ["2022-04-01", 0], ["2022-04-02", 0], ["2022-04-03", 0], ["2022-04-04", 0], ["2022-04-05", 0], ["2022-04-06", 0], ["2022-04-07", 0], ["2022-04-08", 0], ["2022-04-09", 0], ["2022-04-10", 0], ["2022-04-11", 0], ["2022-04-12", 0], ["2022-04-13", 0], ["2022-04-14", 0], ["2022-04-15", 0], ["2022-04-16", 1], ["2022-04-17", 0], ["2022-04-18", 0], ["2022-04-19", 0], ["2022-04-20", 0], ["2022-04-21", 0], ["2022-04-22", 0], ["2022-04-23", 1], ["2022-04-24", 0], ["2022-04-25", 0], ["2022-04-26", 0], ["2022-04-27", 1], ["2022-04-28", 0], ["2022-04-29", 0], ["2022-04-30", 0], ["2022-05-01", 0], ["2022-05-02", 0], ["2022-05-03", 0], ["2022-05-04", 0], ["2022-05-05", 0], ["2022-05-06", 0], ["2022-05-07", 0], ["2022-05-08", 0], ["2022-05-09", 0], ["2022-05-10", 0], ["2022-05-11", 0], ["2022-05-12", 0], ["2022-05-13", 0], ["2022-05-14", 0], ["2022-05-15", 0], ["2022-05-16", 0], ["2022-05-17", 0], ["2022-05-18", 0], ["2022-05-19", 0], ["2022-05-20", 0], ["2022-05-21", 0], ["2022-05-22", 0], ["2022-05-23", 0], ["2022-05-24", 0]]
        }]

    };

    myChart.setOption(option);
</script>

    

    

    <div id="cd-timeline" class="container">
        
        <div class="cd-timeline-block">

            
            
            
            <div class="cd-timeline-img year" data-aos="zoom-in-up">
                <a href="/archives/2021">2021</a>
            </div>
            

            
            
            
            <div class="cd-timeline-img month" data-aos="zoom-in-up">
                <a href="/archives/2021/12">12</a>
            </div>
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/proto-mode/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/18.jpg" class="responsive-img" alt="原型模式">
                                
                                <span class="card-title">原型模式</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    也称为克隆模式，克隆模式的核心就是一个 Clone 方法，Clone 方法的功能就是拷贝父本的所有属性，主要包括两个过程：

分配一块新的内存空间给新的对象；
拷贝父本对象的所有属性。
浅拷贝与深拷贝浅拷贝只拷贝引用类型对象的指针（指向），
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E5%AD%A6%E4%B9%A0/" class="post-category">
                                    学习
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/"><span class="chip bg-color">设计模式</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
        <div class="cd-timeline-block">

            
            

            
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/builder-mode/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/21.jpg" class="responsive-img" alt="建造者模式">
                                
                                <span class="card-title">建造者模式</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    将一个复杂对象的构建与它的表示分离，使得同样的构建过程可以创建不同的表示
用户只需要给出复杂对象的类型和内容，建造者模式负责按顺序创建复杂对象（把内部的建造过程和细节隐藏起来）

例子以生活中建造房子为例子，假设造房子简化为如下步骤：（1）
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E5%AD%A6%E4%B9%A0/" class="post-category">
                                    学习
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/"><span class="chip bg-color">设计模式</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
        <div class="cd-timeline-block">

            
            

            
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/factory-mode/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/19.jpg" class="responsive-img" alt="工厂模式">
                                
                                <span class="card-title">工厂模式</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    实例化对象不使用new，用工厂方法代替将选择实现类，创建对象同意管理和控制。从而将调用者和我们的实现类解耦。

简单工厂模式用来生产同意等级结构中的任意产品（对于新增加的产品，需要覆盖已有代码）
这是最简单的一个版本，只有一个工厂类 Sim
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E5%AD%A6%E4%B9%A0/" class="post-category">
                                    学习
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/"><span class="chip bg-color">设计模式</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
        <div class="cd-timeline-block">

            
            

            
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/abstract-factory/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/9.jpg" class="responsive-img" alt="抽象工厂">
                                
                                <span class="card-title">抽象工厂</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    抽象工厂模式提供了一个创建一系列相关或者相互依赖对象的接口，无需指定它们具体的类。抽象工厂模式又是工厂方法模式的升级版本，工厂方法模式不能解决具有二级分类的产品的创建，抽象工厂模式就是用来解决这一缺陷的。

适用场景：客户端（应用层）不依赖
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E5%AD%A6%E4%B9%A0/" class="post-category">
                                    学习
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/"><span class="chip bg-color">设计模式</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
        <div class="cd-timeline-block">

            
            

            
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/str-to-int/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/3.jpg" class="responsive-img" alt="字符串转换整数">
                                
                                <span class="card-title">字符串转换整数</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    请你来实现一个 atoi 函数，使其能将字符串转换成整数。

分析首先，该函数会根据需要丢弃无用的开头空格字符，直到寻找到第一个非空格的字符为止。接下来的转化规则如下：
如果第一个非空字符为正或者负号时，则将该符号与之后面尽可能多的连续数字
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E7%AE%97%E6%B3%95/" class="post-category">
                                    算法
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/leetcode/"><span class="chip bg-color">leetcode</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
        <div class="cd-timeline-block">

            
            

            
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/effect-word/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/15.jpg" class="responsive-img" alt="有效的字母异位词">
                                
                                <span class="card-title">有效的字母异位词</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    题目：给定两个字符串 s 和 t ，编写一个函数来判断 t 是否是 s 的字母异位词。

示例 1:
输入: s = &quot;&quot;anagram&quot;&quot;, t = &quot;&quot;nagaram&quot
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E7%AE%97%E6%B3%95/" class="post-category">
                                    算法
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/leetcode/"><span class="chip bg-color">leetcode</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
        <div class="cd-timeline-block">

            
            

            
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/only-str/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/21.jpg" class="responsive-img" alt="字符串中的第一个字符">
                                
                                <span class="card-title">字符串中的第一个字符</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    题目：编写一个函数，其作用是将输入的字符串反转过来。输入字符串以字符数组 char[] 的形式给出。不要给另外的数组分配额外的空间，你必须原地修改输入数组、使用 O(1) 的额外空间解决这一问题。

分析你可以假设数组中的所有字符都是 AS
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E7%AE%97%E6%B3%95/" class="post-category">
                                    算法
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/leetcode/"><span class="chip bg-color">leetcode</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
        <div class="cd-timeline-block">

            
            

            
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/str-reverse/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/2.jpg" class="responsive-img" alt="字符串反转">
                                
                                <span class="card-title">字符串反转</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    题目：编写一个函数，其作用是将输入的字符串反转过来。输入字符串以字符数组 char[] 的形式给出。不要给另外的数组分配额外的空间，你必须原地修改输入数组、使用 O(1) 的额外空间解决这一问题。

分析你可以假设数组中的所有字符都是 AS
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E7%AE%97%E6%B3%95/" class="post-category">
                                    算法
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/leetcode/"><span class="chip bg-color">leetcode</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
        <div class="cd-timeline-block">

            
            

            
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/int-reverse/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/3.jpg" class="responsive-img" alt="整数反转">
                                
                                <span class="card-title">整数反转</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    题目：给出一个 32 位的有符号整数，你需要将这个整数中每位上的数字进行反转。

分析示例 1:
输入: 123
输出: 321

 示例 2:
输入: -123
输出: -321

示例 3:
输入: 120
输出: 21

注意:
假设
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E7%AE%97%E6%B3%95/" class="post-category">
                                    算法
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/leetcode/"><span class="chip bg-color">leetcode</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
        <div class="cd-timeline-block">

            
            

            
            

            
            <div class="cd-timeline-img day" data-aos="zoom-in-up">
                <span>21</span>
            </div>
            <article class="cd-timeline-content" data-aos="fade-up">
                <div class="article col s12 m6">
                    <div class="card">
                        <a href="/2021/12/21/three-num-add/">
                            <div class="card-image">
                                
                                
                                <img src="/medias/featureimages/8.jpg" class="responsive-img" alt="三数之和">
                                
                                <span class="card-title">三数之和</span>
                            </div>
                        </a>
                        <div class="card-content article-content">
                            <div class="summary block-with-text">
                                
                                    给定一个包含 n 个整数的数组 nums，判断 nums 中是否存在三个元素 a，b，c ，使得 a + b + c = 0 ？找出所有满足条件且不重复的三元组。


注意：答案中不可以包含重复的三元组。
例如, 给定数组 nums = [
                                
                            </div>
                            <div class="publish-info">
                                <span class="publish-date">
                                    <i class="far fa-clock fa-fw icon-date"></i>2021-12-21
                                </span>
                                <span class="publish-author">
                                    
                                    <i class="fas fa-bookmark fa-fw icon-category"></i>
                                    
                                    <a href="/categories/%E7%AE%97%E6%B3%95/" class="post-category">
                                    算法
                                    </a>
                                    
                                    
                                </span>
                            </div>
                        </div>

                        
                        <div class="card-action article-tags">
                            
                            <a href="/tags/leetcode/"><span class="chip bg-color">leetcode</span></a>
                            
                        </div>
                        
                    </div>
                </div>
            </article>
        </div>
        
    </div>

</main>


<div class="container paging">
    <div class="row">
        <div class="col s6 m4 l4">
            
            <a href="/archives/2021/12/"
               class="left btn-floating btn-large waves-effect waves-light bg-color">
                <i class="fas fa-angle-left"></i>
            </a>
            
        </div>
        <div class="page-info col m4 l4 hide-on-small-only">
            <div class="center-align b-text-gray">2 / 5</div>
        </div>
        <div class="col s6 m4 l4">
            
            <a href="/archives/2021/12/page/3/"
               class="right btn-floating btn-large waves-effect waves-light bg-color">
                <i class="fas fa-angle-right"></i>
            </a>
            
        </div>
    </div>
</div>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        display: none;
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        display: none;
        
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="647710478"
                   fixed='true'
                   autoplay='false'
                   theme='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/libs/aplayer/APlayer.min.js"></script>
<script src="/libs/aplayer/Meting.min.js"></script>

    

    <div class="container row center-align"
         style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2021-2022</span>
            
            <a href="/about" target="_blank">jack006</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            
            
                
            
            
                <span id="busuanzi_container_site_pv">
                &nbsp;|&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;
                    <span id="busuanzi_value_site_pv" class="white-color"></span>
            </span>
            
            
                <span id="busuanzi_container_site_uv">
                &nbsp;|&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;
                    <span id="busuanzi_value_site_uv" class="white-color"></span>
            </span>
            
            <br>

            <!-- 运行天数提醒. -->
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/mybasket-jack" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:2354738434@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2354738434" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 2354738434" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    

    

    <!-- 雪花特效 -->
    

    <!-- 鼠标星星特效 -->
    

     
        <script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
        <script src="/libs/others/TencentCaptcha.js"></script>
        <button id="TencentCaptcha" data-appid="xxxxxxxxxx" data-cbfn="callback" type="button" hidden></button>
    

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    <!--腾讯兔小巢-->
    
    

    

    

    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
